Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Automounter #360

Merged
merged 6 commits into from
Sep 17, 2022
Merged

Add Automounter #360

merged 6 commits into from
Sep 17, 2022

Conversation

servusdei2018
Copy link
Contributor

Re: #355

A slightly modified version of vermaden/automount was bundled into the userland, and devd was configured accordingly. It resides in /usr/sbin/automount, and is automatically called by devd when removable media is inserted, as well as events related to CD-ROMS (devd-specific configuration is located at /etc/devd/automount_devd.conf). A pre-configured automount.conf is bundled into /etc/automount.conf, with the configuration to perform as needed.

Upon insertion, removable media should now be automatically mounted under /Volumes, and upon removal the corresponding directory should be deleted. In addition, automount is configured to prefer the volume label over the device name.

I couldn't figure out how to initialize the packages it needs into the base system itself, e.g:

  • sysutils/exfat-utils for exFAT
  • sysutils/fusefs-ntfs for NTFS
  • sysutils/fusefs-ext2 for EXT4
  • sysutils/fusefs-hfsfuse for HFS/HFS+
  • sysutils/fusefs-lkl for XFS
  • sysutils/fusefs-simple-mtpfs for MTP

But once those are installed, automount should have everything it needs to function perfectly.

Comment on lines +5 to +6
# disable automatic opening of file manager
FM=''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may eventually be configured to automatically open up Filer if desired.

Comment on lines +1 to +43
# PENDRIVE/PHONE/SDCARD insert
notify 100 {
match "system" "DEVFS";
match "type" "CREATE";
match "cdev" "(da|mmcsd|ugen)[0-9]+.*";
action "/usr/sbin/automount $cdev attach &";
};

# PENDRIVE/PHONE/SDCARD remove
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(da|mmcsd|ugen)[0-9]+.*";
action "/usr/sbin/automount $cdev detach &";
};

# CD-ROM media inject
notify 100 {
match "system" "DEVFS";
match "type" "CREATE|MEDIACHANGE";
match "cdev" "(cd)[0-9]+.*";
action "/usr/sbin/automount $cdev attach &";
};

# CD-ROM media eject
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(cd)[0-9]+.*";
action "/usr/sbin/automount $cdev detach &";
};

# CD-ROM no media
notify 100 {
match "system" "CAM";
match "subsystem" "periph";
match "type" "error";
match "cam_status" "0xcc";
match "scsi_status" "2";
match "scsi_sense" "70 02 3a 02";
match "device" "(cd)[0-9]+.*";
action "/usr/sbin/automount $device detach &";
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devd-specific configuration

@@ -420,6 +420,7 @@ DIRDEPS+= \
usr.sbin/auditreduce \
usr.sbin/authpf \
usr.sbin/autofs \
usr.sbin/automount \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include the appropriate makefile for automount

Comment on lines +185 to +188
# read configuration files
if [ -f /etc/automount.conf ] ; then
. /etc/automount.conf
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only difference between this automount and the upstream vermaden/automount. vermaden/automount doesn't support /etc/automount.conf by default.

Copy link
Collaborator

@mszoek mszoek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I will make a separate issue for those extra filesystem packages - we need to build and package those into the ISO. This can be merged as is for now. Thanks for your contribution!

@mszoek mszoek merged commit 316c914 into ravynsoft:main Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants